﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Yunchang.ILUI;
namespace Yunchang.ILUI
{
    /// <summary>
    /// View 操作对象,每个View的使用对象都是自动生成的
    /// 绑定UIMono 后就自动生成 View 代码
    /// </summary>
    public class UIViewBase
    {
        public UIMono uiMono { get; private set; }
        public UIViewBase() { }
        public UIViewBase(UIMono uiMono)
        {
            InjectMono(uiMono);
        }

        public virtual void InjectMono(UIMono uIMono)
        {
            this.uiMono = uIMono;
        }
        public GameObject gameObject { get { return uiMono != null ? uiMono.gameObject : null; } }
        public RectTransform rectTransform { get { return uiMono != null ? (RectTransform)uiMono.gameObject.transform : null; } }
    }
}
